package com.suke.czx.modules.performance.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.suke.czx.common.validate.*;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 应用模块名称: 绩效
 * 代码描述: 绩效实体
 * copyright: AUZAR ALL RIGHTS RESERVED
 * company: AUZAR
 *
 * @author: 颜米晨
 * @date: 2021/09/27 2:33
 */
@Data
@ApiModel(value = "绩效管理")
@EqualsAndHashCode(callSuper = true)
public class Performance extends Model<Performance> {

    @ApiModelProperty(value = "绩效id")
    @TableId(value = "performance_id", type = IdType.AUTO)
    @NotNull(groups = {PerformanceUpdateGroup.class}, message = "绩效编码不能为空")
    public Long performanceId;

    @ApiModelProperty(value = "绩效名称")
    @NotBlank(groups = {PerformanceSaveGroup.class, PerformanceUpdateGroup.class}, message = "绩效名称不能为空")
    public String performanceName;

    @ApiModelProperty(value = "绩效类型 1 项目绩效 2 内部绩效")
    @NotNull(groups = {PerformanceSaveGroup.class, PerformanceUpdateGroup.class}, message = "绩效类型不能为空")
    @EnumValue(groups = {PerformanceSaveGroup.class, PerformanceUpdateGroup.class}, intValues = {1, 2}, message = "绩效类型只能是1,2")
    private Integer type;

    @TableField(exist = false)
    @ApiModelProperty(value = "绩效类型名称")
    public String typeName;

    @ApiModelProperty(value = "员工编码")
    @NotNull(groups = {PerformanceSaveGroup.class, PerformanceUpdateGroup.class}, message = "员工编码不能为空")
    public Long userId;

    @TableField(exist = false)
    @ApiModelProperty(value = "员工姓名")
    public String name;

    @ApiModelProperty(value = "任务编码")
    public Long taskId;

    @TableField(exist = false)
    @ApiModelProperty(value = "任务名称")
    public String taskName;

    @ApiModelProperty(value = "任务绩效分数")
    public Double performanceCategory;

    @ApiModelProperty(value = "依据")
    public String fact;

    @ApiModelProperty(value = "备注")
    public String note;

    @ApiModelProperty(value = "删除标记  0：删除   1：正常")
    public Integer del;

    @ApiModelProperty(value = "创建者id")
    public Long creator;

    @ApiModelProperty(value = "创建时间")
    public Date createTime;

    @ApiModelProperty(value = "更新者id")
    public Long updater;

    @ApiModelProperty(value = "更新时间")
    public Date updateTime;

}
